<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <?php include 'inc/head.php'; ?>
</head>

<body>
  <?php include 'inc/header.php'; ?>

  <div class="container">

    <?php
    echo form_create(
      ['action' => M('admin', 'detail', 'add_action')],
      [
        ['type' => 'part_start'],
        ['type' => 'text', 'label' => '标题', 'key' => 'd_name', 'required' => 'required'],
        ['type' => 'select', 'label' => '所属', 'key' => 'd_parent', 'value' => channel_select_list(0, 0), 'html' => true],
        ['type' => 'radio', 'label' => '推荐', 'key' => 'd_rec', 'value' => [
          ['label' => '是', 'value' => 1],
          ['label' => '否', 'value' => 0, 'checked' => 'checked'],
        ]],
        ['type' => 'radio', 'label' => '热门', 'key' => 'd_hot', 'value' => [
          ['label' => '是', 'value' => 1],
          ['label' => '否', 'value' => 0, 'checked' => 'checked'],
        ]],
        ['type' => 'text', 'label' => '标签', 'key' => 'd_tag', 'placeholder' => '请使用英文逗号","分割'],
        ['type' => 'editor', 'label' => '详情', 'key' => 'd_content'],
        ['type' => 'editor', 'label' => '简介', 'key' => 'd_scontent'],
        ['type' => 'text', 'label' => '来源', 'key' => 'd_source', 'value' => '本站'],
        ['type' => 'text', 'label' => '作者', 'key' =>
        'd_author'],
        ['type' => 'datetime', 'label' => '添加时间', 'key' => 'd_date', 'value' => local_date('Y-m-d', gmtime())
          . 'T' . local_date('H:i', gmtime()), 'required' =>
        'required'],
        ['type' => 'date', 'label' => '生效日期', 'key' => 'd_sdate'],
        [
          'type' => 'date', 'label' => '失效日期',
          'key' => 'd_edate'
        ],
        ['type' => 'text', 'label' => '排序', 'key' => 'd_order', 'value' => 100, 'placeholder' => '数字越小排列越靠前', 'required' =>
        'required'],
        ['type' => 'part_end'],

        ['type' => 'part_start'],
        ['type' => 'upload_img', 'label' => '图片标题', 'key' => 'd_picture'],
        ['type' => 'upload_imgs', 'label' => '组图', 'key' => 'd_slideshow'],
        ['type' => 'upload_attachment', 'label' => '附件', 'key' => 'd_attachment'],
        ['type' => 'text', 'label' => '外部链接', 'key' => 'd_link', 'placeholder' => '填写后会跳转到指定的地址'],
        ['type' => 'part_end'],

        ['type' => 'part_start'],
        ['type' => 'text', 'label' => '优化标题', 'key' => 'd_seoname'],
        ['type' => 'text', 'label' => '关键字', 'key' => 'd_keywords'],
        ['type' => 'textarea', 'label' => '描述', 'key' => 'd_description'],
        ['type' => 'part_end'],

        ['type' => 'submit', 'label' => '提交', 'key' => 'save']
      ],
      ['基本', '附属', 'SEO']
    );
    ?>

  </div>

  <?php include 'inc/footer.php'; ?>

</body>

</html>